<?php
require_once('App-Top.php');
require_once('Authorizer.php');
require_once('GenFunctions.php');

// Check if it is Member Mng
if (isset($_SESSION['SESS_USER_TYPE'])) {
    if (!isUserType_Members($_SESSION['SESS_USER_TYPE'])) {
        header("Location: AdminIndex.php");
        exit();
    }
}

//TODO: Validate fields and show errors here...

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Event Edit - Confirmation</title>
        <link href="StyleControl.css" rel="stylesheet" type="text/css" />
    </head>
    <body>

        <div id="sidebar">
            <h3>Reports</h3>
            <ul>
                <li><a href="#">Gate List</a></li>
                <li><a href="#">Members List</a></li>
            </ul>


            <?php
            require_once('MenuAdmin.php');
            ?>
        </div>

        <div id="mainbody">
            <h1>Event Edition - Confirmation</h1> <br />

            <form id="editionEvent" name="editionEvent" method="POST" action="AdminEventEditExec.php" class="compactform">
                <fieldset class="clearfix">
                    <legend>Read Only Fields - Click Edit to Modify Them</legend>
                    <br />
                    <div class="threeper">
                        <label for="etitle">Title
                        <input name="etitle" type="text" id="etitle" readonly="readonly" value="<?php if (isset($_POST['etitle'])) { echo $_POST['etitle']; } ?>"  /></label>

                        <label for="espkrname">Speaker Name
                        <input name="espkrname" type="text" id="espkrname" readonly="readonly" value="<?php if (isset($_POST['espkrname'])) { echo $_POST['espkrname']; } ?>"  /></label>

                        <label for="espkrinfo">Speaker Info
                        <input name="espkrinfo" type="text" id="espkrinfo" readonly="readonly" value="<?php if (isset($_POST['espkrinfo'])) { echo $_POST['espkrinfo']; } ?>"  /></label>

                    </div>

                    <div class="twoper">
                        <label for="edate"> Date
                        <input name="edate" type="text" id="edate" class="datefield" readonly="readonly" value="<?php if (isset($_POST['edate'])) { echo $_POST['edate']; } else { echo date("m/d/Y");}?>"  /></label>

                        <label for="etime"> Time
                        <select name="etime" id="etime" style="width:8em;" >
                            <?php
                                if (isset($_POST['etime']))
                                {
                                    echo "<option value='" . $_POST['etime'] . "'>" . $_POST['etime']. "</option>";
                                }
                            ?>
                        </select>
                        </label>

                    </div>

                    <div class="twoper">
                        <label for="evenuename">Venue Name
                        <input  name="evenuename" type="text" id="evenuename" readonly="readonly" value="<?php if (isset($_POST['evenuename'])) { echo $_POST['evenuename']; } ?>"  /></label>


                        <label for="evenueinfo">Venue Info
                        <input  name="evenueinfo" type="text" id="evenueinfo" readonly="readonly" value="<?php if (isset($_POST['evenueinfo'])) { echo $_POST['evenueinfo']; } ?>"  /></label>

                    </div>

                    <div class="twoper">
                        <label for="etype">Type
                        <select name="etype" id="etype" style="width:8em;" >
                            <?php
                                function giveNameEventType($value)
                                {
                                    switch (strtolower($value))
                                    {
                                        case 'a':
                                            return 'AGM';
                                            break;
                                        case 'w':
                                            return 'Whiffette';
                                            break;
                                        case 'r':
                                        default:
                                            return 'Regular';
                                            break;
                                    }
                                }

                                if (isset($_POST['etype']))
                                {
                                    echo "<option value='" . $_POST['etype'] . "'>" . giveNameEventType($_POST['etype']) . "</option>";
                                }
                            ?>
                        </select> </label>

                        <label for="estatus">Status
                        <select name="estatus" id="estatus" style="width:8em;" >
                            <?php
                                function giveNameEventStatus($value)
                                {
                                    switch (strtolower($value))
                                    {
                                        case 'u':
                                            return 'Upcoming';
                                            break;
                                        case 'c':
                                            return 'Cancelled';
                                            break;
                                        case 'b':
                                            return 'Blocked';
                                            break;
                                        case 'n':
                                        default:
                                            return 'Normal';
                                            break;
                                    }
                                }

                                if (isset($_POST['estatus']))
                                {
                                    echo "<option value='" . $_POST['estatus'] . "'>" . giveNameEventStatus($_POST['estatus']) . "</option>";
                                }
                            ?>
                        </select> </label>

                   </div>

                    <div class="twoper">
                        <label for="efeemem">Fee Member
                        <input name="efeemem" type="text" id="efeemem" readonly="readonly" value="<?php if (isset($_POST['efeemem'])) { echo $_POST['efeemem']; } ?>"  /> </label>


                        <label for="efeeguest">Fee Guest
                        <input name="efeeguest" type="text" id="efeeguest" readonly="readonly" value="<?php if (isset($_POST['efeeguest'])) { echo $_POST['efeeguest']; } ?>" /> </label>

                    </div>

                    <div class="oneper">
                        <label for="edescription">Description
                        <textarea rows="15" cols="10" name="edescription" id="edescription" readonly="readonly">
                            <?php if (isset($_POST['edescription'])) { echo rtrim(ltrim($_POST['edescription'])); } ?>
                        </textarea></label>

                    </div>

                    <div class="twoper">
                        <input type="submit" name="ConfirmEditEvent" value="Confirm Event" class="button"/>
                        <input type="submit" name="EditEditEvent" value="Edit Event" class="button"/>

                    </div>

                </fieldset>
            </form>

           

            <?php

            if (isset($_POST['estatus']))
            {
                if (strcasecmp($_POST['estatus'], 'U') == 0 || strcasecmp($_POST['estatus'], 'B') == 0 )
                {
                     echo '<p class="note">By setting this event as Upcoming/Blocked, the current Upcoming/Blocked event will become Active. <br />
                                           Hence, The one you are confirming will become the Upcoming/Blocked event that people could see in the RSVP Page.</p></p>';
                }
            }
            ?>

           

        </div>

    </body>
</html>
<?php

    require_once('App-End.php');
?>

<!-- Designed: Jose Trujillo - 2011 -->